package com.probiz.estore.common.model.product.base;

import java.io.Serializable;
import java.math.BigDecimal;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.core.model.BaseObject;

/**
 * ProductStat Base Java Bean, base class for the model, mapped directly to database table
 * <p/>
 * Avoid changing this file if not necessary, will be overwritten.
 * <p/>
 */
public class ProductStatTbl extends BaseObject implements Serializable {

    protected Integer productStatId;
    protected Integer viewCount;
    protected Integer numOfPositiveRate;
    protected Integer numOfNeutralRate;
    protected Integer numOfNegativeRate;
    protected Integer buyCount;//购买个数
    protected Integer buyTimes;//购买次数
    protected Integer reviewCount;
    protected Integer onShowReviewCount;
    protected BigDecimal reviewScore;
    protected Integer version;


    /**
     * Default Empty Constructor for class ProductStat
     */
    public ProductStatTbl() {
        super();
    }

    /**
     * Default Key Fields Constructor for class ProductStat
     */
    public ProductStatTbl(
            Integer in_productStatId
    ) {
        this.setProductStatId(in_productStatId);
    }


    /**
     * * @return Integer
     *
     * @hibernate.id column="productStatId" type="java.lang.Integer" generator-class="native"
     */
    public Integer getProductStatId() {
        return this.productStatId;
    }

    /**
     * Set the productStatId
     */
    public void setProductStatId(Integer aValue) {
        this.productStatId = aValue;
    }

    /**
     * * @return Integer
     *
     * @hibernate.property column="viewCount" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getViewCount() {
        return this.viewCount;
    }

    /**
     * Set the viewCount
     *
     * @spring.validator type="required"
     */
    public void setViewCount(Integer aValue) {
        this.viewCount = aValue;
    }

    /**
     * * @return Integer
     *
     * @hibernate.property column="numOfPositiveRate" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getNumOfPositiveRate() {
        return this.numOfPositiveRate;
    }

    /**
     * Set the numOfPositiveRate
     *
     * @spring.validator type="required"
     */
    public void setNumOfPositiveRate(Integer aValue) {
        this.numOfPositiveRate = aValue;
    }

    /**
     * * @return Integer
     *
     * @hibernate.property column="numOfNeutralRate" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getNumOfNeutralRate() {
        return this.numOfNeutralRate;
    }

    /**
     * Set the numOfNeutralRate
     *
     * @spring.validator type="required"
     */
    public void setNumOfNeutralRate(Integer aValue) {
        this.numOfNeutralRate = aValue;
    }

    /**
     * * @return Integer
     *
     * @hibernate.property column="numOfNegativeRate" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getNumOfNegativeRate() {
        return this.numOfNegativeRate;
    }

    /**
     * Set the numOfNegativeRate
     *
     * @spring.validator type="required"
     */
    public void setNumOfNegativeRate(Integer aValue) {
        this.numOfNegativeRate = aValue;
    }

    /**
     * * @return Integer
     *
     * @hibernate.property column="buyCount" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getBuyCount() {
        return this.buyCount;
    }

    /**
     * Set the buyCount
     *
     * @spring.validator type="required"
     */
    public void setBuyCount(Integer aValue) {
        this.buyCount = aValue;
    }
    
   
    public Integer getBuyTimes() {
		return buyTimes;
	}

	public void setBuyTimes(Integer buyTimes) {
		this.buyTimes = buyTimes;
	}

	public Integer getReviewCount() {
		return reviewCount;
	}

	public void setReviewCount(Integer reviewCount) {
		this.reviewCount = reviewCount;
	}

	public Integer getOnShowReviewCount() {
		return onShowReviewCount;
	}

	public void setOnShowReviewCount(Integer onShowReviewCount) {
		this.onShowReviewCount = onShowReviewCount;
	}
	
	public BigDecimal getReviewScore() {
		return reviewScore;
	}

	public void setReviewScore(BigDecimal reviewScore) {
		this.reviewScore = reviewScore;
	}

	/**
     * * @return Integer
     *
     * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getVersion() {
        return this.version;
    }


    /**
     * Set the version
     *
     * @spring.validator type="required"
     */
    public void setVersion(Integer aValue) {
        this.version = aValue;
    }

    /**
     * @see java.lang.Object#equals(Object)
     */
    public boolean equals(Object object) {
        if (!(object instanceof ProductStatTbl)) {
            return false;
        }
        ProductStatTbl rhs = (ProductStatTbl) object;
        return new EqualsBuilder()
                .append(this.productStatId, rhs.productStatId)
                .append(this.viewCount, rhs.viewCount)
                .append(this.numOfPositiveRate, rhs.numOfPositiveRate)
                .append(this.numOfNeutralRate, rhs.numOfNeutralRate)
                .append(this.numOfNegativeRate, rhs.numOfNegativeRate)
                .append(this.buyCount, rhs.buyCount)
                .append(this.version, rhs.version)
                .isEquals();
    }

    /**
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        return new HashCodeBuilder(-82280557, -700257973)
                .append(this.productStatId)
                .append(this.viewCount)
                .append(this.numOfPositiveRate)
                .append(this.numOfNeutralRate)
                .append(this.numOfNegativeRate)
                .append(this.buyCount)
                .append(this.version)
                .toHashCode();
    }

    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return new ToStringBuilder(this)
                .append("productStatId", this.productStatId)
                .append("viewCount", this.viewCount)
                .append("numOfPositiveRate", this.numOfPositiveRate)
                .append("numOfNeutralRate", this.numOfNeutralRate)
                .append("numOfNegativeRate", this.numOfNegativeRate)
                .append("buyCount", this.buyCount)
                .append("version", this.version)
                .toString();
    }

    /**
     * Return the name of the first key column
     */
    public String getFirstKeyColumnName() {
        return "productStatId";
    }

    /**
     * Return the Id (pk) of the entity, must be Integer
     */
    public Integer getId() {
        return productStatId;
    }


}